home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Dialogs.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  23.0 KB  |  787 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Dialogs.a
  3. ;
  4. ;    Contains:    Dialog Manager interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  19. __DIALOGS__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  28.     include 'Events.a'
  29.     ENDIF
  30.     IF &TYPE('__MACWINDOWS__') = 'UNDEFINED' THEN
  31.     include 'MacWindows.a'
  32.     ENDIF
  33.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  34.     include 'TextEdit.a'
  35.     ENDIF
  36.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  37.     include 'Controls.a'
  38.     ENDIF
  39.  
  40.  
  41.                                                             ; new, more standard names for dialog item types
  42. kControlDialogItem                EQU        4
  43. kButtonDialogItem                EQU        4
  44. kCheckBoxDialogItem                EQU        5
  45. kRadioButtonDialogItem            EQU        6
  46. kResourceControlDialogItem        EQU        7
  47. kStaticTextDialogItem            EQU        8
  48. kEditTextDialogItem                EQU        16
  49. kIconDialogItem                    EQU        32
  50. kPictureDialogItem                EQU        64
  51. kUserDialogItem                    EQU        0
  52. kItemDisableBit                    EQU        128
  53.  
  54.                                                             ; old names for dialog item types
  55. ctrlItem                        EQU        4
  56. btnCtrl                            EQU        0
  57. chkCtrl                            EQU        1
  58. radCtrl                            EQU        2
  59. resCtrl                            EQU        3
  60. statText                        EQU        8
  61. editText                        EQU        16
  62. iconItem                        EQU        32
  63. picItem                            EQU        64
  64. userItem                        EQU        0
  65. itemDisable                        EQU        128
  66.  
  67.                                                             ; standard dialog item numbers
  68. kStdOkItemIndex                    EQU        1
  69. kStdCancelItemIndex                EQU        2                    ; old names
  70. ok                                EQU        1
  71. cancel                            EQU        2
  72.  
  73.                                                             ; standard icon resource id's     
  74. kStopIcon                        EQU        0
  75. kNoteIcon                        EQU        1
  76. kCautionIcon                    EQU        2                    ; old names
  77. stopIcon                        EQU        0
  78. noteIcon                        EQU        1
  79. cautionIcon                        EQU        2
  80.  
  81.  
  82.  
  83.     IF OLDROUTINENAMES THEN
  84.  
  85. ;   These constants lived briefly on ETO 16.  They suggest
  86. ;   that there is only one index you can use for the OK 
  87. ;   item, which is not true.  You can put the ok item 
  88. ;   anywhere you want in the DITL.
  89.  
  90.  
  91.  
  92. kOkItemIndex                    EQU        1
  93. kCancelItemIndex                EQU        2
  94.     ENDIF    ; OLDROUTINENAMES
  95. ;     Dialog Item List Manipulation Constants    
  96. ; typedef SInt16                         DITLMethod
  97.  
  98.  
  99. overlayDITL                        EQU        0
  100. appendDITLRight                    EQU        1
  101. appendDITLBottom                EQU        2
  102. ; typedef SInt16                         StageList
  103.  
  104. ;  DialogRef is obsolete. Use DialogPtr instead.
  105. ; typedef DialogPtr                     DialogRef
  106.  
  107. DialogRecord            RECORD 0
  108. window                     ds        WindowRecord    ; offset: $0 (0)
  109. items                     ds.l    1                ; offset: $9C (156)
  110. textH                     ds.l    1                ; offset: $A0 (160)
  111. editField                 ds.w    1                ; offset: $A4 (164)
  112. editOpen                 ds.w    1                ; offset: $A6 (166)
  113. aDefItem                 ds.w    1                ; offset: $A8 (168)
  114. sizeof                     EQU *                    ; size:   $AA (170)
  115.                         ENDR
  116. ; typedef struct DialogRecord *            DialogPeek
  117.  
  118. DialogTemplate            RECORD 0
  119. boundsRect                 ds        Rect            ; offset: $0 (0)
  120. procID                     ds.w    1                ; offset: $8 (8)
  121. visible                     ds.b    1                ; offset: $A (10)
  122. filler1                     ds.b    1                ; offset: $B (11)
  123. goAwayFlag                 ds.b    1                ; offset: $C (12)
  124. filler2                     ds.b    1                ; offset: $D (13)
  125. refCon                     ds.l    1                ; offset: $E (14)
  126. itemsID                     ds.w    1                ; offset: $12 (18)
  127. title                     ds        Str255            ; offset: $14 (20)
  128. sizeof                     EQU *                    ; size:   $114 (276)
  129.                         ENDR
  130. ; typedef struct DialogTemplate *        DialogTPtr
  131.  
  132. ; typedef DialogTPtr *                    DialogTHndl
  133.  
  134. AlertTemplate            RECORD 0
  135. boundsRect                 ds        Rect            ; offset: $0 (0)
  136. itemsID                     ds.w    1                ; offset: $8 (8)
  137. stages                     ds.w    1                ; offset: $A (10)
  138. sizeof                     EQU *                    ; size:   $C (12)
  139.                         ENDR
  140. ; typedef struct AlertTemplate *        AlertTPtr
  141.  
  142. ; typedef AlertTPtr *                    AlertTHndl
  143.  
  144. ;  new type abstractions for the dialog manager 
  145. ; typedef SInt16                         DialogItemIndexZeroBased
  146.  
  147. ; typedef SInt16                         DialogItemIndex
  148.  
  149. ; typedef SInt16                         DialogItemType
  150.  
  151. ;  dialog manager callbacks 
  152.  
  153.     IF ¬ TARGET_OS_MAC THEN
  154. ;  QuickTime 3.0 
  155. ;
  156. ; pascal void SetModelessDialogCallbackProc(DialogPtr theDialog, QTModelessCallbackProcPtr callbackProc)
  157. ;
  158.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  159.         IMPORT_CFM_FUNCTION SetModelessDialogCallbackProc
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal OSErr GetDialogControlNotificationProc(void *theProc)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  166.         IMPORT_CFM_FUNCTION GetDialogControlNotificationProc
  167.     ENDIF
  168.  
  169. ;
  170. ; pascal void SetDialogMovableModal(DialogPtr theDialog)
  171. ;
  172.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  173.         IMPORT_CFM_FUNCTION SetDialogMovableModal
  174.     ENDIF
  175.  
  176. ;
  177. ; pascal void *GetDialogParent(DialogPtr theDialog)
  178. ;
  179.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  180.         IMPORT_CFM_FUNCTION GetDialogParent
  181.     ENDIF
  182.  
  183.     ENDIF
  184.  
  185. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  186. ;      • Following types are valid with Appearance 1.0 and later
  187. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  188.  
  189.  
  190.  
  191.                                                             ; Alert types to pass into StandardAlert 
  192. kAlertStopAlert                    EQU        0
  193. kAlertNoteAlert                    EQU        1
  194. kAlertCautionAlert                EQU        2
  195. kAlertPlainAlert                EQU        3
  196. ; typedef SInt16                         AlertType
  197.  
  198.  
  199. kAlertDefaultOKText                EQU        -1                    ; "OK"
  200. kAlertDefaultCancelText            EQU        -1                    ; "Cancel"
  201. kAlertDefaultOtherText            EQU        -1                    ; "Don't Save"
  202. ;  StandardAlert alert button numbers 
  203.  
  204. kAlertStdAlertOKButton            EQU        1
  205. kAlertStdAlertCancelButton        EQU        2
  206. kAlertStdAlertOtherButton        EQU        3
  207. kAlertStdAlertHelpButton        EQU        4
  208.  
  209.                                                             ; Dialog Flags for use in NewFeaturesDialog or dlgx resource 
  210. kDialogFlagsUseThemeBackground    EQU        $01
  211. kDialogFlagsUseControlHierarchy    EQU        $02
  212. kDialogFlagsHandleMovableModal    EQU        $04
  213. kDialogFlagsUseThemeControls    EQU        $08
  214.  
  215.                                                             ; Alert Flags for use in alrx resource 
  216. kAlertFlagsUseThemeBackground    EQU        $01
  217. kAlertFlagsUseControlHierarchy    EQU        $02
  218. kAlertFlagsAlertIsMovable        EQU        $04
  219. kAlertFlagsUseThemeControls        EQU        $08
  220. ;  For dftb resource 
  221.  
  222. kDialogFontNoFontStyle            EQU        0
  223. kDialogFontUseFontMask            EQU        $0001
  224. kDialogFontUseFaceMask            EQU        $0002
  225. kDialogFontUseSizeMask            EQU        $0004
  226. kDialogFontUseForeColorMask        EQU        $0008
  227. kDialogFontUseBackColorMask        EQU        $0010
  228. kDialogFontUseModeMask            EQU        $0020
  229. kDialogFontUseJustMask            EQU        $0040
  230. kDialogFontUseAllMask            EQU        $00FF
  231. kDialogFontAddFontSizeMask        EQU        $0100
  232. kDialogFontUseFontNameMask        EQU        $0200
  233. AlertStdAlertParamRec    RECORD 0
  234. movable                     ds.b    1                ; offset: $0 (0)        ;  Make alert movable modal 
  235. helpButton                 ds.b    1                ; offset: $1 (1)        ;  Is there a help button? 
  236. filterProc                 ds.l    1                ; offset: $2 (2)        ;  Event filter 
  237. defaultText                 ds.l    1                ; offset: $6 (6)        ;  Text for button in OK position 
  238. cancelText                 ds.l    1                ; offset: $A (10)        ;  Text for button in cancel position 
  239. otherText                 ds.l    1                ; offset: $E (14)        ;  Text for button in left position 
  240. defaultButton             ds.w    1                ; offset: $12 (18)        ;  Which button behaves as the default 
  241. cancelButton             ds.w    1                ; offset: $14 (20)        ;  Which one behaves as cancel (can be 0) 
  242. position                 ds.w    1                ; offset: $16 (22)        ;  Position (kWindowDefaultPosition in this case 
  243. ;  equals kWindowAlertPositionParentWindowScreen) 
  244. sizeof                     EQU *                    ; size:   $18 (24)
  245.                         ENDR
  246. ; typedef struct AlertStdAlertParamRec * AlertStdAlertParamPtr
  247.  
  248. ;  ——— end Appearance 1.0 or later stuff
  249.  
  250.  
  251.  
  252.  
  253.  
  254. ;    NOTE: Code running under MultiFinder or System 7.0 or newer
  255. ;    should always pass NULL to InitDialogs.
  256. ;
  257.  
  258. ;
  259. ; pascal void InitDialogs(void *ignored)
  260. ;
  261.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  262.         _InitDialogs:    OPWORD    $A97B
  263.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  264.         IMPORT_CFM_FUNCTION InitDialogs
  265.     ENDIF
  266.  
  267. ;
  268. ; pascal void ErrorSound(SoundUPP soundProc)
  269. ;
  270.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  271.         _ErrorSound:    OPWORD    $A98C
  272.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  273.         IMPORT_CFM_FUNCTION ErrorSound
  274.     ENDIF
  275.  
  276. ;
  277. ; pascal DialogPtr NewDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle items)
  278. ;
  279.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  280.         _NewDialog:    OPWORD    $A97D
  281.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  282.         IMPORT_CFM_FUNCTION NewDialog
  283.     ENDIF
  284.  
  285. ;
  286. ; pascal DialogPtr GetNewDialog(SInt16 dialogID, void *dStorage, WindowPtr behind)
  287. ;
  288.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  289.         _GetNewDialog:    OPWORD    $A97C
  290.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  291.         IMPORT_CFM_FUNCTION GetNewDialog
  292.     ENDIF
  293.  
  294. ;
  295. ; pascal DialogPtr NewColorDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle items)
  296. ;
  297.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  298.         _NewColorDialog:    OPWORD    $AA4B
  299.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  300.         IMPORT_CFM_FUNCTION NewColorDialog
  301.     ENDIF
  302.  
  303. ;
  304. ; pascal void CloseDialog(DialogPtr theDialog)
  305. ;
  306.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  307.         _CloseDialog:    OPWORD    $A982
  308.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  309.         IMPORT_CFM_FUNCTION CloseDialog
  310.     ENDIF
  311.  
  312. ;
  313. ; pascal void DisposeDialog(DialogPtr theDialog)
  314. ;
  315.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  316.         _DisposeDialog:    OPWORD    $A983
  317.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  318.         IMPORT_CFM_FUNCTION DisposeDialog
  319.     ENDIF
  320.  
  321. ;
  322. ; pascal void ModalDialog(ModalFilterUPP modalFilter, DialogItemIndex *itemHit)
  323. ;
  324.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  325.         _ModalDialog:    OPWORD    $A991
  326.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  327.         IMPORT_CFM_FUNCTION ModalDialog
  328.     ENDIF
  329.  
  330. ;
  331. ; pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  332. ;
  333.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  334.         _IsDialogEvent:    OPWORD    $A97F
  335.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  336.         IMPORT_CFM_FUNCTION IsDialogEvent
  337.     ENDIF
  338.  
  339. ;
  340. ; pascal Boolean DialogSelect(const EventRecord *theEvent, DialogPtr *theDialog, DialogItemIndex *itemHit)
  341. ;
  342.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  343.         _DialogSelect:    OPWORD    $A980
  344.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  345.         IMPORT_CFM_FUNCTION DialogSelect
  346.     ENDIF
  347.  
  348. ;
  349. ; pascal void DrawDialog(DialogPtr theDialog)
  350. ;
  351.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  352.         _DrawDialog:    OPWORD    $A981
  353.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  354.         IMPORT_CFM_FUNCTION DrawDialog
  355.     ENDIF
  356.  
  357. ;
  358. ; pascal void UpdateDialog(DialogPtr theDialog, RgnHandle updateRgn)
  359. ;
  360.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  361.         _UpdateDialog:    OPWORD    $A978
  362.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  363.         IMPORT_CFM_FUNCTION UpdateDialog
  364.     ENDIF
  365.  
  366. ;
  367. ; pascal void HideDialogItem(DialogPtr theDialog, DialogItemIndex itemNo)
  368. ;
  369.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  370.         _HideDialogItem:    OPWORD    $A827
  371.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  372.         IMPORT_CFM_FUNCTION HideDialogItem
  373.     ENDIF
  374.  
  375. ;
  376. ; pascal void ShowDialogItem(DialogPtr theDialog, DialogItemIndex itemNo)
  377. ;
  378.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  379.         _ShowDialogItem:    OPWORD    $A828
  380.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  381.         IMPORT_CFM_FUNCTION ShowDialogItem
  382.     ENDIF
  383.  
  384. ;
  385. ; pascal DialogItemIndexZeroBased FindDialogItem(DialogPtr theDialog, Point thePt)
  386. ;
  387.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  388.         _FindDialogItem:    OPWORD    $A984
  389.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  390.         IMPORT_CFM_FUNCTION FindDialogItem
  391.     ENDIF
  392.  
  393. ;
  394. ; pascal DialogItemIndex Alert(SInt16 alertID, ModalFilterUPP modalFilter)
  395. ;
  396.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  397.         _Alert:    OPWORD    $A985
  398.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  399.         IMPORT_CFM_FUNCTION Alert
  400.     ENDIF
  401.  
  402. ;
  403. ; pascal DialogItemIndex StopAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  404. ;
  405.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  406.         _StopAlert:    OPWORD    $A986
  407.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  408.         IMPORT_CFM_FUNCTION StopAlert
  409.     ENDIF
  410.  
  411. ;
  412. ; pascal DialogItemIndex NoteAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  413. ;
  414.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  415.         _NoteAlert:    OPWORD    $A987
  416.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  417.         IMPORT_CFM_FUNCTION NoteAlert
  418.     ENDIF
  419.  
  420. ;
  421. ; pascal DialogItemIndex CautionAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  422. ;
  423.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  424.         _CautionAlert:    OPWORD    $A988
  425.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  426.         IMPORT_CFM_FUNCTION CautionAlert
  427.     ENDIF
  428.  
  429. ;
  430. ; pascal void GetDialogItem(DialogPtr theDialog, DialogItemIndex itemNo, DialogItemType *itemType, Handle *item, Rect *box)
  431. ;
  432.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  433.         _GetDialogItem:    OPWORD    $A98D
  434.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  435.         IMPORT_CFM_FUNCTION GetDialogItem
  436.     ENDIF
  437.  
  438. ;
  439. ; pascal void SetDialogItem(DialogPtr theDialog, DialogItemIndex itemNo, DialogItemType itemType, Handle item, const Rect *box)
  440. ;
  441.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  442.         _SetDialogItem:    OPWORD    $A98E
  443.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  444.         IMPORT_CFM_FUNCTION SetDialogItem
  445.     ENDIF
  446.  
  447. ;
  448. ; pascal void ParamText(ConstStr255Param param0, ConstStr255Param param1, ConstStr255Param param2, ConstStr255Param param3)
  449. ;
  450.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  451.         _ParamText:    OPWORD    $A98B
  452.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  453.         IMPORT_CFM_FUNCTION ParamText
  454.     ENDIF
  455.  
  456. ;
  457. ; pascal void SelectDialogItemText(DialogPtr theDialog, DialogItemIndex itemNo, SInt16 strtSel, SInt16 endSel)
  458. ;
  459.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  460.         _SelectDialogItemText:    OPWORD    $A97E
  461.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  462.         IMPORT_CFM_FUNCTION SelectDialogItemText
  463.     ENDIF
  464.  
  465. ;
  466. ; pascal void GetDialogItemText(Handle item, Str255 text)
  467. ;
  468.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  469.         _GetDialogItemText:    OPWORD    $A990
  470.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  471.         IMPORT_CFM_FUNCTION GetDialogItemText
  472.     ENDIF
  473.  
  474. ;
  475. ; pascal void SetDialogItemText(Handle item, ConstStr255Param text)
  476. ;
  477.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  478.         _SetDialogItemText:    OPWORD    $A98F
  479.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  480.         IMPORT_CFM_FUNCTION SetDialogItemText
  481.     ENDIF
  482.  
  483. ;
  484. ; pascal SInt16 GetAlertStage(void)
  485. ;
  486.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  487.         Macro
  488.         _GetAlertStage        &dest=(sp)
  489.             move.w            $0A9A,&dest
  490.         EndM
  491.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  492.         IMPORT_CFM_FUNCTION GetAlertStage
  493.     ENDIF
  494.  
  495. ;
  496. ; pascal void SetDialogFont(SInt16 value)
  497. ;
  498.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  499.         Macro
  500.         _SetDialogFont        &src=(sp)+
  501.             move.w            &src,$0AFA
  502.         EndM
  503.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  504.         IMPORT_CFM_FUNCTION SetDialogFont
  505.     ENDIF
  506.  
  507. ;
  508. ; pascal void ResetAlertStage(void )
  509. ;
  510.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  511.         Macro
  512.         _ResetAlertStage
  513.             clr.w               $0A9A
  514.         EndM
  515.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  516.         IMPORT_CFM_FUNCTION ResetAlertStage
  517.     ENDIF
  518.  
  519.  
  520. ;
  521. ; pascal void AppendDITL(DialogPtr theDialog, Handle theHandle, DITLMethod method)
  522. ;
  523.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  524.         IMPORT_CFM_FUNCTION AppendDITL
  525.     ENDIF
  526.  
  527. ;
  528. ; pascal DialogItemIndex CountDITL(DialogPtr theDialog)
  529. ;
  530.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  531.         IMPORT_CFM_FUNCTION CountDITL
  532.     ENDIF
  533.  
  534. ;
  535. ; pascal void ShortenDITL(DialogPtr theDialog, DialogItemIndex numberItems)
  536. ;
  537.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  538.         IMPORT_CFM_FUNCTION ShortenDITL
  539.     ENDIF
  540.  
  541. ;
  542. ; pascal OSErr GetStdFilterProc(ModalFilterUPP *theProc)
  543. ;
  544.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  545.         Macro
  546.         _GetStdFilterProc
  547.             move.w              #$0203,D0
  548.             dc.w                $AA68
  549.         EndM
  550.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  551.         IMPORT_CFM_FUNCTION GetStdFilterProc
  552.     ENDIF
  553.  
  554. ;
  555. ; pascal OSErr SetDialogDefaultItem(DialogPtr theDialog, DialogItemIndex newItem)
  556. ;
  557.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  558.         Macro
  559.         _SetDialogDefaultItem
  560.             move.w              #$0304,D0
  561.             dc.w                $AA68
  562.         EndM
  563.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  564.         IMPORT_CFM_FUNCTION SetDialogDefaultItem
  565.     ENDIF
  566.  
  567. ;
  568. ; pascal OSErr SetDialogCancelItem(DialogPtr theDialog, DialogItemIndex newItem)
  569. ;
  570.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  571.         Macro
  572.         _SetDialogCancelItem
  573.             move.w              #$0305,D0
  574.             dc.w                $AA68
  575.         EndM
  576.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  577.         IMPORT_CFM_FUNCTION SetDialogCancelItem
  578.     ENDIF
  579.  
  580. ;
  581. ; pascal OSErr SetDialogTracksCursor(DialogPtr theDialog, Boolean tracks)
  582. ;
  583.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  584.         Macro
  585.         _SetDialogTracksCursor
  586.             move.w              #$0306,D0
  587.             dc.w                $AA68
  588.         EndM
  589.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  590.         IMPORT_CFM_FUNCTION SetDialogTracksCursor
  591.     ENDIF
  592.  
  593.  
  594.  
  595.  
  596. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  597. ;      • Appearance Dialog Routines (available only with Appearance 1.0 and later)
  598. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  599.  
  600.  
  601.  
  602. ;
  603. ; pascal DialogPtr NewFeaturesDialog(void *inStorage, const Rect *inBoundsRect, ConstStr255Param inTitle, Boolean inIsVisible, SInt16 inProcID, WindowPtr inBehind, Boolean inGoAwayFlag, SInt32 inRefCon, Handle inItemListHandle, UInt32 inFlags)
  604. ;
  605.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  606.         Macro
  607.         _NewFeaturesDialog
  608.             move.w              #$110C,D0
  609.             dc.w                $AA68
  610.         EndM
  611.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  612.         IMPORT_CFM_FUNCTION NewFeaturesDialog
  613.     ENDIF
  614.  
  615. ;
  616. ; pascal OSErr AutoSizeDialog(DialogPtr inDialog)
  617. ;
  618.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  619.         Macro
  620.         _AutoSizeDialog
  621.             move.w              #$020D,D0
  622.             dc.w                $AA68
  623.         EndM
  624.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  625.         IMPORT_CFM_FUNCTION AutoSizeDialog
  626.     ENDIF
  627.  
  628. ;
  629. ; pascal OSErr StandardAlert(AlertType inAlertType, StringPtr inError, StringPtr inExplanation, AlertStdAlertParamPtr inAlertParam, SInt16 *outItemHit)
  630. ;
  631.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  632.         Macro
  633.         _StandardAlert
  634.             move.w              #$090E,D0
  635.             dc.w                $AA68
  636.         EndM
  637.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  638.         IMPORT_CFM_FUNCTION StandardAlert
  639.     ENDIF
  640.  
  641. ;
  642. ; pascal OSErr GetDialogItemAsControl(DialogPtr inDialog, SInt16 inItemNo, ControlHandle *outControl)
  643. ;
  644.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  645.         Macro
  646.         _GetDialogItemAsControl
  647.             move.w              #$050F,D0
  648.             dc.w                $AA68
  649.         EndM
  650.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  651.         IMPORT_CFM_FUNCTION GetDialogItemAsControl
  652.     ENDIF
  653.  
  654. ;
  655. ; pascal OSErr MoveDialogItem(DialogPtr inDialog, SInt16 inItemNo, SInt16 inHoriz, SInt16 inVert)
  656. ;
  657.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  658.         Macro
  659.         _MoveDialogItem
  660.             move.w              #$0510,D0
  661.             dc.w                $AA68
  662.         EndM
  663.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  664.         IMPORT_CFM_FUNCTION MoveDialogItem
  665.     ENDIF
  666.  
  667. ;
  668. ; pascal OSErr SizeDialogItem(DialogPtr inDialog, SInt16 inItemNo, SInt16 inWidth, SInt16 inHeight)
  669. ;
  670.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  671.         Macro
  672.         _SizeDialogItem
  673.             move.w              #$0511,D0
  674.             dc.w                $AA68
  675.         EndM
  676.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  677.         IMPORT_CFM_FUNCTION SizeDialogItem
  678.     ENDIF
  679.  
  680.     IF OLDROUTINENAMES THEN
  681.     ENDIF    ; OLDROUTINENAMES
  682. ;    *****************************************************************************
  683. ;    *                                                                           *
  684. ;    * The conditional STRICT_DIALOGS has been removed from this interface file. *
  685. ;    * The accessor macros to a DialogRecord are no longer necessary.            *
  686. ;    *                                                                           *
  687. ;    * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  688. ;    *                                                                           *
  689. ;    *****************************************************************************
  690. ;
  691. ;    Details:
  692. ;    The original purpose of the STRICT_ conditionals and accessor macros was to
  693. ;    help ease the transition to Copland.  Shared data structures are difficult
  694. ;    to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  695. ;    WindowRecord and other data structures, we would begin the migration to the
  696. ;    discipline wherein system data structures are completely hidden from
  697. ;    applications.
  698. ;    
  699. ;    After many design reviews, we finally concluded that with this sort of
  700. ;    migration, the system could never tell when an application was no longer
  701. ;    peeking at a WindowRecord, and thus the data structure might never become
  702. ;    system owned.  Additionally, there were many other limitations in the
  703. ;    classic toolbox that were begging to be addressed.  The final decision was
  704. ;    to leave the traditional toolbox as a compatibility mode.
  705. ;    
  706. ;    We also decided to use the Handle and Ptr based types in the function
  707. ;    declarations.  For example, NewWindow now returns a WindowPtr rather than a
  708. ;    WindowRef.  The Ref types are still defined in the header files, so all
  709. ;    existing code will still compile exactly as it did before.  There are
  710. ;    several reasons why we chose to do this:
  711. ;    
  712. ;    - The importance of backwards compatibility makes it unfeasible for us to
  713. ;    enforce real opaque references in the implementation anytime in the
  714. ;    foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  715. ;    ControlRef, etc.) in the documentation and header files would always be a
  716. ;    fake veneer of opacity.
  717. ;    
  718. ;    - There exists a significant base of books and sample code that neophyte
  719. ;    Macintosh developers use to learn how to program the Macintosh.  These
  720. ;    books and sample code all use direct data access.  Introducing opaque data
  721. ;    types at this point would confuse neophyte programmers more than it would
  722. ;    help them.
  723. ;    
  724. ;    - Direct data structure access is used by nearly all Macintosh developers. 
  725. ;    Changing the interfaces to reflect a false opacity would not provide any
  726. ;    benefit to these developers.
  727. ;    
  728. ;    - Accessor functions are useful in and of themselves as convenience
  729. ;    functions, without being tied to opaque data types.  We will complete and
  730. ;    document the Windows and Dialogs accessor functions in an upcoming release
  731. ;    of the interfaces.
  732. ;
  733.  
  734.  
  735.  
  736.  
  737. ;
  738. ; pascal void CouldDialog(SInt16 dialogID)
  739. ;
  740.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  741.         _CouldDialog:    OPWORD    $A979
  742.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  743.         IMPORT_CFM_FUNCTION CouldDialog
  744.     ENDIF
  745.  
  746. ;
  747. ; pascal void FreeDialog(SInt16 dialogID)
  748. ;
  749.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  750.         _FreeDialog:    OPWORD    $A97A
  751.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  752.         IMPORT_CFM_FUNCTION FreeDialog
  753.     ENDIF
  754.  
  755. ;
  756. ; pascal void CouldAlert(SInt16 alertID)
  757. ;
  758.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  759.         _CouldAlert:    OPWORD    $A989
  760.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  761.         IMPORT_CFM_FUNCTION CouldAlert
  762.     ENDIF
  763.  
  764. ;
  765. ; pascal void FreeAlert(SInt16 alertID)
  766. ;
  767.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  768.         _FreeAlert:    OPWORD    $A98A
  769.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  770.         IMPORT_CFM_FUNCTION FreeAlert
  771.     ENDIF
  772.  
  773.  
  774.  
  775.  
  776.  
  777.     IF ¬ TARGET_OS_MAC THEN
  778.     ENDIF
  779.  
  780.  
  781.  
  782.  
  783.     ENDIF ; __DIALOGS__ 
  784.  
  785.